<?php
class Admin_bank_manager_model extends model
{
	function __construct()
	{
		parent::__construct();	
	}
	
	function getAllResult()
	{
		
		$query = $this->db->get_where('bur_bank_managers',array('bank_manager_id' => '1'));
		return $query->result();
	}
	
	function updatedetails($arr)
	{
			$cond = array('bank_manager_id' => '1');
			$this->db->where($cond);
			$this->db->update('bur_bank_managers',$arr);
	
	}
	
	function getAdminEmail()
	{
		$this->load->database();
		$query = $this->db->get('bur_admin_emails');
		$arr = array();
		if($query->num_rows > 0)
		{
			foreach($query->result() as $rows)
			{
				if($rows->email_address != '')
				{
					array_push($arr, $rows->email_address);
				}
			}
		}
		return $arr;
	}
    
    function send_contact_email2($name,$company,$telephone,$email,$message)
    {
    	$config = array(
    		'mailtype'=>'html'
        );
        $data = array(                              
            'name'=> $name,
            'company' => $company,
            'telephone' => $telephone,
            'email' => $email,
            'message' => $message
        );
        
        $email_content = $this->load->view(TEMPLATE_NAME.'/front/mail/contact_us',$data, true);
        
        $this->load->library('email');
        $this->email->initialize($config);
        $this->email->from('noreply@mykprisguide.com', NOREPLY_ADD);
        $this->email->to($this->getAdminEmail());
        
        $this->email->reply_to('noreply@mykprisguide.com', NOREPLY_ADD);
              
        $this->email->subject('Contact Message');
        $this->email->message($email_content);                
        $this->email->send();
        return true;	
  }
}	
?>